import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { WechatMpInfoVO, WechatMpInfoForm, WechatMpInfoQuery } from '@/api/device/wechatMpInfo/types';

/**
 * 查询系统参数列表
 * @param query
 * @returns {*}
 */

export const listWechatMpInfo = (query?: WechatMpInfoQuery): AxiosPromise<WechatMpInfoVO[]> => {
  return request({
    url: '/device/wechatMpInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询系统参数详细
 * @param id
 */
export const getWechatMpInfo = (id: string | number): AxiosPromise<WechatMpInfoVO> => {
  return request({
    url: '/device/wechatMpInfo/' + id,
    method: 'get'
  });
};

/**
 * 新增系统参数
 * @param data
 */
export const addWechatMpInfo = (data: WechatMpInfoForm) => {
  return request({
    url: '/device/wechatMpInfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改系统参数
 * @param data
 */
export const updateWechatMpInfo = (data: WechatMpInfoForm) => {
  return request({
    url: '/device/wechatMpInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除系统参数
 * @param id
 */
export const delWechatMpInfo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/device/wechatMpInfo/' + id,
    method: 'delete'
  });
};
